Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

symbolic timezones don't work with tzinfo

#28

The documentation implies that including tzinfo will allow time zones like "America/New_York" to function. However, this simple test script explodes when trying to access the date field.


!/usr/bin/ruby

require "pp"
require "rubygems"
require "tzinfo"
require "ri_cal"
require "open-uri"

open("http://mhvlug.org/calendar/ical") do |file|

@@cal = RiCal.parse(file)

end

pp @@cal.first.events.last.dtstart

The exception is as follows:

/var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/component/calendar.rb:155:in find_timezone': "America/New_York" is not the identifier of a VTIMEZONE component of this calendar (RiCal::InvalidTimezoneIdentifier)

from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/component.rb:67:in `find_timezone'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time/timezone_support.rb:27:in `find_timezone'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time/timezone_support.rb:32:in `timezone'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time/timezone_support.rb:61:in `rational_tz_offset'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/property_value/date_time.rb:304:in `ruby_value'
from /var/lib/gems/1.8/gems/ri_cal-0.8.5/lib/ri_cal/properties/event.rb:134:in `dtstart'
from ./riparse.rb:13

Reported by Sean Dague · January 10th, 2010 @ 07:13 PM

State: invalid
Milestone: none
Assigned to: Rick DeNatale Rick DeNatale

Activity

  1. Rick DeNatale
    Rick DeNatale
    • State changed from new to invalid

    RiCal only uses TZInfo to create calendars.

    The ical file provided is invalid because contrary to RFC 2445 it does not contain VTIMEZONE components sufficient to resolve all (actually in this case any) of the times with timezones within the file.

    This is a bug in whatever software produced that file. (The drupal calendar api according to the product id), not in RiCal.

    January 10th, 2010 @ 08:01 PM

  2. Sean Dague
    Sean Dague

    Ok, I misread the documentation, and thought ri_cal supported this. I'll continue to use icalendar.rb then as it works fine with the drupal ical feeds.

    January 10th, 2010 @ 08:15 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.